package com.dlc.shop.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dlc.shop.bean.model.AttachFileGroup;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author chendt
 * @date 2021/7/7 17:21
 */
public interface AttachFileGroupMapper extends BaseMapper<AttachFileGroup> {
    /**
     * 获取列表
     * @param shopId
     * @param type
     * @return
     */
    List<AttachFileGroup> list(@Param("shopId") Long shopId, @Param("type") Integer type);

    /**
     * 根据id获取
     *
     * @param attachFileGroupId id
     * @return
     */
    AttachFileGroup getByAttachFileGroupId(@Param("attachFileGroupId") Long attachFileGroupId);

    /**
     * 保存
     *
     * @param attachFileGroup
     */
    void save(@Param("attachFileGroup") AttachFileGroup attachFileGroup);

    /**
     * 更新
     *
     * @param attachFileGroup
     */
    void update(@Param("attachFileGroup") AttachFileGroup attachFileGroup);

    /**
     * 根据id删除
     *
     * @param attachFileGroupId
     */
    void deleteById(@Param("attachFileGroupId") Long attachFileGroupId);

    /**
     * 根据分组名称查询分组数量
     * @param name
     * @param shopId
     * @param type
     * @return
     */
    int getGroupCountByName(@Param("name")String name,@Param("shopId")Long shopId,@Param("type")Integer type);
}
